﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DLL.Courseware
{
	/// <summary>
	/// 课件实体类
	/// </summary>
	/// <![CDATA[2014-8-23 11:16:31]]>
	public class Entity : EntityBase
	{
		#region 属性
		public string strName = "";
		public int nSortID = 0;
		public int nUserID = 0;
		public int nDepartmentID = 0;
		public string strDateTime = "";
		public string strIP = "";
		public string strPath = "";
		public string strType = "";
		public int nPublic = 0;

		private string strSort = "";
		#endregion 属性

		#region Get、Set属性

		public string SortName
		{
			get { return strSort; }
			set { strSort = value; }
		}
		public string Name
		{
			get { return strName; }
			set { strName = value.Trim(); }
		}
		public int SortID
		{
			get { return nSortID; }
			set { nSortID = value; }
		}
		public int UserID
		{
			get { return nUserID; }
			set { nUserID = value; }
		}
		public int DepartmentID
		{
			get { return nDepartmentID; }
			set { nDepartmentID = value; }
		}
		public string DateTime
		{
			get { return strDateTime; }
			set { strDateTime = value.Trim(); }
		}
		public string IP
		{
			get { return strIP; }
			set { strIP = value.Trim(); }
		}
		public string Path
		{
			get { return strPath; }
			set { strPath = value.Trim(); }
		}
		public string Type
		{
			get { return strType; }
			set { strType = value.Trim(); }
		}
		public bool Public
		{
			get
			{
				if (nPublic == clsConfig.nCourseware_Public)
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			set
			{
				if (value == true)
				{
					nPublic = clsConfig.nCourseware_Public;
				}
				else
				{
					nPublic = clsConfig.nCourseware_NoPublic;
				}
			}
		}

		/// <summary>
		/// 课件上传日期
		/// </summary>
		public string Date
		{
			get
			{
				return TonyNet4V1.CommonFunction.FormatDate(strDateTime, page);
			}
		}
		#endregion Get、Set属性

		private Config clsConfig = new Config();

		#region 构造函数
		/// <summary>
		/// 实体类构造函数
		/// </summary>
		/// <![CDATA[2014-8-23 11:16:31]]>
		public Entity()
			: base()
		{
		}
		#endregion 构造函数
	}
}
